package com.lovely602.langchain4j.param.controller.chat;


import dev.langchain4j.model.chat.ChatModel;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 *
 * @author lizhixing
 */
@Slf4j
@RestController
@RequestMapping(value = "/param")
public class ModelParamController {


    @Resource(name = "chatModelQwen")
    private ChatModel qwenChatModel;


    /**
     * 设置聊天模型参数聊天接口
     */
    @RequestMapping(value = "/chat")
    public String chat(@RequestParam(value = "msg", defaultValue = "hello", required = true) String msg) {
        return qwenChatModel.chat(msg);
    }


}
